#-*- coding: utf-8 -*-

## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.

## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.

## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

import wx

class VMenu(wx.MenuBar):
    '''La barra de menús de Pyragua'''

    def __init__(self, ventana):
        
        wx.MenuBar.__init__(self)
        self.ventana = ventana

        menus = [(wx.Menu(), "Archivo"), (wx.Menu(), "Edicion"),
                 (wx.Menu(), "Ver"), (wx.Menu(), "Ejecutar"),
                 (wx.Menu(), "Ayuda")]

        for menu in menus:
            self.Append(menu[0], menu[1])
 
	menu_archivo=[
                (wx.ID_NEW, "&Nuevo\tCtrl-N", u'Crear una nueva pestaña', self.ventana.nuevo),
		(wx.ID_OPEN, "&Abrir\tCtrl-O", 'Abrir un archivo', self.ventana.abrir),
                (wx.ID_SAVE, "&Guardar\tCtrl-S", "Guardar el archivo actual", self.ventana.guardar),
                (wx.ID_SAVEAS, 'Guardar C&omo', 'Posibilita guardar el archivo de manera diferente',
                   self.ventana.guardar_como),
                (None, None, None, None),
                (wx.ID_EXIT, "&Cerrar\tCtrl-X", "Cerrar Pyragua", self.ventana.cerrar)]


	for id, label, texto, metodo in menu_archivo:
		if id == None:
                   menus[0][0].AppendSeparator()
		else:
                   item = menus[0][0].Append(id, label, texto)  ###se añaden las opciones al menú archivo y se conectan con 									sus respectivos métodos.
                   self.ventana.Bind(wx.EVT_MENU, metodo, item)
		




